unit observaciones;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, DBCtrls, DBLocalS;

type
  TfrmObservaciones = class(TForm)
    DBMemo1: TDBMemo;
    sPresupuesto: TDataSource;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);

  private
    Ftexto: string;
    procedure Settexto(const Value: string);
    { Private declarations }
  published
    property texto: string read Ftexto write Settexto;

  public
    constructor Entrar(AOwner: TComponent; ds: TSQLClientDataSet);
  end;

var
  frmObservaciones: TfrmObservaciones;

implementation

uses MDatos;

{$R *.dfm}

constructor TfrmObservaciones.Entrar(AOwner: TComponent; ds: TSQLClientDataSet);
begin
  inherited Create(AOwner);
  self.sPresupuesto.DataSet := ds;
  self.texto := self.DBMemo1.Field.AsString;
  ShowModal;
end;

procedure TfrmObservaciones.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  if self.sPresupuesto.DataSet.State in [dsEdit, dsInsert] then
    self.sPresupuesto.DataSet.Post;
  Action := caFree;
end;

procedure TfrmObservaciones.Settexto(const Value: string);
begin
  Ftexto := Value;
end;

end.
